package com.sanen.flyer.factory;

import com.sanen.flyer.entity.FlyObject;
import com.sanen.flyer.entity.Jet;
import com.sanen.flyer.tool.ImageTool;

import java.awt.image.BufferedImage;

/**
 * 火焰喷射器(推进器)工厂
 * @author wsse
 * @date 2018-09-20 11:19
 */
public class JetFactory {
    public static final int JET_BLUE=1;
    private static BufferedImage jetBlue;

    public static Jet getJet(int type, FlyObject fly,int xOffset, int yOffset){
        switch (type){
            case JET_BLUE:
                return new Jet(fly,getJetBlue(),xOffset,yOffset);
        }
        return null;
    }

    private static synchronized BufferedImage getJetBlue() {
        if (jetBlue==null)jetBlue= ImageTool.getImage("./image/jet/jetBlue.png");
        return jetBlue;
    }
}
